Random intercepts model using hiv-intervention data

Topics to be covered

  • What you will learn
    • Mathematical formulation of random intercepts model
    • Description of HIV-intervention data
    • Random intercepts model using hiv-intervention data
    • Mathematical formulation of random slopes model
    • Assumptions and complications

Longitudinal data

  • Measurements taken at different times
    • Emphasis in changes over time

Random intercepts model, 1 of 3

  • Simplest pattern for longitudinal data
  • \(Y_{ij},\ i=1,...,n;\ j=1,...,k\)
    • n subjects, k time points
  • \(t_j\), time of jth measurement
    • First time is often zero

Random intercepts model, 2 of 3

  • \(Y_{ij}=\beta_0+u_{0i}+\beta_1 t_j + \epsilon_{ij}\)
    • \(\beta_0\) and \(\beta_1\) are unknown constants
    • \(u_{0i}\) and \(\epsilon_{ij}\) are normally distributed
      • \(SD(u_{0i})=\sigma_{intercept}\)
      • \(SD(\epsilon_{ij})=\sigma_{error}\)

Random intercepts model, 3 of 3

  • \(SD(Y_{ij})=\sqrt{\sigma^2_{intercept}\ +\ \sigma^2_{error}}\)
  • \(Corr(Y_{ij}, Y_{im})=\frac{\sigma^2_{intercept}}{\sigma^2_{intercept}\ +\ \sigma^2_{error}}\)

Random intercepts illustrated, 1 of 2

Random intercepts illustrated, 2 of 2

Break #1

  • What you have learned
    • Mathematical formulation of random intercepts model
  • What’s coming next
    • Description of HIV-intervention data

Description of hiv-intervention data, 1 of 2

data_dictionary: hiv-intervention.txt
source: OzDASL website
description: |
  This is a longitudinal study of an intervention in 14-18 adolescents  intended to increase the frequency of condom protected sex. Subjects  were allocated randomly to treatment or control groups. All were evaluated prior to the intervention, immediately  after the intervention, 6 months and  12 months after the intervention.The outcome variable is the logarithm-transformed frequency of condom-protected sex ( log(Y+1) )."

Description of hiv-intervention data, 2 of 2

BST:
  label: treatment group
  values:
    '1': BST intervention
    '0': control
Pre:
  label: Log-frequency of protected sex before the intervention
Post:
  label: Log-frequency of protected sex after the intervention
FU6:
  label: Log-frequency of protected sex reported at the 6 months follow-up
FU12:
  label: Log-frequency of protected sex reported at the 12 months follow-up

Wide format

Boxplots

Colors and patterns

Tall format

Alternate clustering of boxplots

Live demo, restructuring and boxplots

After menu Graph | Boxplot

After button Define

After menu Data | Restructure

After button Next

After button Next

After button Next

After button Next

After menu Transform | Recode into Different Variables

After button Old and New Values

After menu Graphs | Boxplot

After button Define

Break #2

  • What you have learned
    • Description of HIV-intervention data
  • What’s coming next
    • Random intercepts model using hiv-intervention data

Random intercepts analysis, 1 of 6

Random intercepts analysis, 2 of 6

Random intercepts analysis, 3 of 6

Random intercepts analysis, 4 of 6

Random intercepts analysis, 5 of 6

Random intercepts analysis, 6 of 6

itle: “Restructure demo” ormat: revealjs: slide-number: true embed-resources: true ditor: source

Live demo, Random Intercepts Model

After menu Analyze | Mixed Models | Linear

After button Continue

After button Fixed

After button Random

After button Statistics

After button Save

After button Export

Break #3

  • What you have learned
    • Random intercepts model using hiv-intervention data
  • What’s coming next
    • Mathematical formulation of random slopes model

title: “Mathematical formulation of the random slopes model” format: revealjs: slide-number: true embed-resources: true editor: source

Random slopes model, 1 of 2

  • Same notation for the time and outcome variables
  • \(Y_{ij},\ i=1,...,n;\ j=1,...,k\)
    • n subjects, k time points
  • \(t_j\), time of jth measurement

Random slopes model, 2 of 2

  • \(Y_{ij}=\beta_0+u_{0i}+\beta_1 t_j+u_{0i} t_j+\epsilon_{ij}\)
    • \(\beta_0\) and \(\beta_1\) are unknown constants
    • \(u_{0i}\), \(u_{0i}\), and \(\epsilon_{ij}\) are normally distributed
      • \(SD(u_{0i})=\sigma_{intercept}\)
      • \(SD(u_{1i})=\sigma_{slope}\)
      • \(SD(\epsilon_{ij})=\sigma_{error}\)

Random slopes illustrated, 1 of 2

Random slopes illustrated, 2 of 2

Break #4

  • What you have learned
    • Mathematical formulation of random slopes model
  • What’s coming next
    • Assumptions and complications

title: “Assumptions and complications” format: revealjs: slide-number: true embed-resources: true editor: source

Assumptions

  • Independence
    • Only between subjects
  • Normality
    • Residuals
    • Random intercepts and/or slopes
  • Linearity

Normality check, 1 of 2

Normality check, 2 of 2

Linearity check

Complications

  • Not a problem
    • Missing values
    • Better than Last Observation Carried Forward
  • Problems (more tedious than difficult)
    • Interactions
    • Nonlinear trends
    • Covariates
      • Between patients
      • Within patients

Live demo, normality checks

Summary

  • What you have learned
    • Mathematical formulation of random intercepts model
    • Description of HIV-intervention data
    • Random intercepts model using hiv-intervention data
    • Mathematical formulation of random slopes model
    • Assumptions and complications

Additional topics??

title: “simon-5502-12-slides”